// 关于购物车的请求
import axios from './axiosFun';


//添加数据至购物车表
export const addCart = (param) => {return axios.post('/cart/addCart',param)}

//添加数据至购物车表
export const getCartsById = (param) => {return axios.get('/cart/getCarts?userId='+param)}

//批量删除购物车信息
export const deleteByIds = (params) => {return axios.post('/cart/deleteCarts',params)}

//单个点击删除按钮来删除那一条购物车信息
export const deleteById = (param) => {return axios.get('/cart/deleteCart?id='+param)}

//批量购买购物车
export const buyByIds = (param1,params) => {return axios.post('/cart/buyCarts?addressId='+param1,params)}

//单独点击购买/buyCart
export const buyById = (param1,param2) => {return axios.get('/cart/buyCart?addressId='+param1+"&id="+param2)}

//在详情界面点击直接购买
export const buyDirect = (param1,params) => {return axios.post('/cart/buyCartDirect?addressId='+param1,params)}
